<template>
  <div v-if="isActive" class="tab-pane">
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: 'TabPane',
  props: {
    name: {
      type: String,
      required: true
    },
    label: {
      type: String,
      default: ''
    }
  },
  computed: {
    isActive() {
      return this.$parent.$options.name === 'Tabs' && this.$parent.activeName === this.name;
    }
  }
};
</script>

<style scoped>
.tab-pane {
  display: block;
}
</style>